package com.example.a2032.Utils;

import java.util.HashMap;

public class MoniDataUtils {
    HashMap<String,Long>moniPhoneMap;
    private static MoniDataUtils moniDataUtils=new MoniDataUtils();
    private MoniDataUtils(){
        moniPhoneMap=new HashMap<>();
    }
    public static MoniDataUtils getInstance(){
        return moniDataUtils;
    }
    public void addPhone(String phone){
        long time=System.currentTimeMillis();
        moniPhoneMap.put(phone,time);
    }

    public boolean isMoniPhone(String phone){
        return moniPhoneMap.containsKey(phone);
    }
    public void removePhone(String phone){
        if(moniPhoneMap.containsKey(phone))moniPhoneMap.remove(phone);
    }
}
